SET(CMAKE_SYSTEM_NAME Linux)
#指定系统名，既不是linux也不是windows
SET(CMAKE_SYSTEM_PROCESSOR arm)        #指定处理器名
SET(CMAKE_CROSSCOMPILING TRUE)           #指定是交叉编译

cmake_minimum_required(VERSION 3.2)
SET(TOOLCHAIN_DIR "/home/wang/backup_tina2.5/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain")
SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_DIR})
#SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(C_COMPILER ${TOOLCHAIN_DIR}/bin/arm-openwrt-linux-gcc)
SET(CXX_COMPILER ${TOOLCHAIN_DIR}/bin/arm-openwrt-linux-g++)
SET(CMAKE_C_COMPILER ${TOOLCHAIN_DIR}/bin/arm-openwrt-linux-gcc)
SET(CMAKE_CXX_COMPILER ${TOOLCHAIN_DIR}/bin/arm-openwrt-linux-g++)
MESSAGE(STATUS "TOOLCHAIN_DIR" ${TOOLCHAIN_DIR})
MESSAGE(STATUS "CMAKE_C_COMPILER" ${CMAKE_C_COMPILER})
MESSAGE(STATUS "CMAKE_Cxx_COMPILER" ${CMAKE_CXX_COMPILER})
set(STAGING_DIR "")
set(CMAKE_INCLUDE_PATH ${TOOLCHAIN_DIR}/include)
set(CMAKE_LIBRARY_PATH ${TOOLCHAIN_DIR}/lib)
include_directories(${TOOLCHAIN_DIR}/include)
#project(slamdemo)
# 清替换成您的交叉编译工具  
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
#set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
include_directories(
./
/home/wang/backup_tina2.5/lichee/linux-3.4/tools/virtio
/home/wang/backup_tina2.5/lichee/linux-3.4/include
)
link_libraries(

)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)

SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#COMMON_C/SRC
add_library(sunxi-sndi2s0.ko sunxi-sndi2s0.c
    )
